package com.example.cron.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @Author rlj
 * @Date 2021/4/22 9:46
 * @Version 1.0
 */
@Mapper
public interface ConsultationMapper {


    @Select(value = "SELECT distinct b.im_content_nvarchar FROM im_online_consultation a JOIN im_consultation_log b ON a.order_no_nvarchar = b.rx_order_no_nvarchar WHERE a.oc_status_tinyint = 2 AND b.is_down = 0 AND b.c_type_tinyint = 99 and a.a_type_int in(12, 13)")
    List<String> getImContentList();

    @Update(value = "UPDATE im_consultation_log set is_down = 1 WHERE im_content_nvarchar = #{imId}")
    void updateIsDown(@Param("imId") String imId);
}
